<template>
  <el-select v-bind="inputInfo.inputAttrs" v-model="value" @change="$emit('update:modelValue', $event)">
    <el-option-group
      v-for="group in inputInfo.options"
      :key="group.label"
      :label="group.label"
    >
      <el-option
        v-for="item in group.options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-option-group>
  </el-select>
</template>

<script>
import { defineComponent, ref } from "vue";

export default defineComponent({
  name: 'CommonSelectGroup',
  props: {
    inputInfo: {
      type: Object,
      default: {}
    }
  },
  setup(props) {
    return {
      value: ref(props.inputInfo.value)
    }
  }
})
</script>

<style>

</style>